using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("EuroOdds")]
	[Serializable]
    public class EuroOdd : DBO<EuroOdd>
    {
		#region Fields
		
		private int? _IdEuroOdd;
		private int? _IdMatch;
		private double? _Home;
		private double? _Away;
		private double? _Draw;
		private string _OddsType;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public EuroOdd()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdEuroOdd 
		/// </summary>
		/// <param name="IdEuroOdd">The IdEuroOdd</param>
		public EuroOdd(int? IdEuroOdd )
		{
			this.IdEuroOdd = IdEuroOdd;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdEuroOdd">Sets int? value for IdEuroOdd</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="Home">Sets double? value for Home</param>
		/// <param name="Away">Sets double? value for Away</param>
		/// <param name="Draw">Sets double? value for Draw</param>
		/// <param name="OddsType">Sets string value for OddsType</param>
		public EuroOdd(int? idEuroOdd, int? idMatch, double? home, double? away, double? draw, string oddsType)
		{
			this.IdEuroOdd = idEuroOdd;
			this.IdMatch = idMatch;
			this.Home = home;
			this.Away = away;
			this.Draw = draw;
			this.OddsType = oddsType;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdEuroOdd
		/// </summary>
		[ColumnAttribute("IdEuroOdd", SqlDbType.Int , 4 , true, true, false)]
		public int? IdEuroOdd
		{
			set
			{
				this._IdEuroOdd = value;
			}
			get
			{
				return this._IdEuroOdd;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Home
		/// </summary>
		[ColumnAttribute("Home", SqlDbType.Float , 8 , false, false, true)]
		public double? Home
		{
			set
			{
				this._Home = value;
			}
			get
			{
				return this._Home;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Away
		/// </summary>
		[ColumnAttribute("Away", SqlDbType.Float , 8 , false, false, true)]
		public double? Away
		{
			set
			{
				this._Away = value;
			}
			get
			{
				return this._Away;
			}
		}
		
		/// <summary>
		/// Gets or sets double? value for Draw
		/// </summary>
		[ColumnAttribute("Draw", SqlDbType.Float , 8 , false, false, true)]
		public double? Draw
		{
			set
			{
				this._Draw = value;
			}
			get
			{
				return this._Draw;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for OddsType
		/// </summary>
		[ColumnAttribute("OddsType", SqlDbType.NVarChar , 50 , false, false, true)]
		public string OddsType
		{
			set
			{
				this._OddsType = value;
			}
			get
			{
				return this._OddsType;
			}
		}
		
		
		/// <summary>
		/// Get a Match of current EuroOdd object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdEuroOdd]
            /// </summary>
            public string IdEuroOdd
            {
                get
                {
                    return "IdEuroOdd";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [Home]
            /// </summary>
            public string Home
            {
                get
                {
                    return "Home";
                }
            }
            /// <summary>
            /// Get the name of column [Away]
            /// </summary>
            public string Away
            {
                get
                {
                    return "Away";
                }
            }
            /// <summary>
            /// Get the name of column [Draw]
            /// </summary>
            public string Draw
            {
                get
                {
                    return "Draw";
                }
            }
            /// <summary>
            /// Get the name of column [OddsType]
            /// </summary>
            public string OddsType
            {
                get
                {
                    return "OddsType";
                }
            }
        }
        #endregion
    }
}
